package com.lzh.others.basejava.Thread_21;

import java.util.concurrent.CountDownLatch;

/**
 * @Description:
 * @Author: LiuZiHao
 * @Date: 2022/6/29 10:41
 */
public class MyThread extends Thread {
    public MyThread(CountDownLatch threadSignal) {
        System.out.println("线程启动，需要5秒....");
        for (int i = 0; i < 5; i++) {
            System.out.print(i + 1 + ",");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
        System.out.println("线程创建完毕.....");
    }

    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            System.out.print("i = " + i + ",");

        }
        System.out.println();
    }
}
